package com.toocms.jinjuhang.data.center

import android.os.Parcel
import android.os.Parcelable

data class AddressDetailsData(
    var adr_id: String? = "",
    var type: String? = "",
    var use_organ: String? = "",
    var contacts: String? = "",
    var mobile: String? = "",
    var district_id: String? = "",
    var province_name: String? = "",
    var city_name: String? = "",
    var district_name: String? = "",
    var address: String? = "",
    var is_default: String? = "",
    var longitude: String? = "",
    var latitude: String? = ""
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(adr_id)
        parcel.writeString(type)
        parcel.writeString(contacts)
        parcel.writeString(mobile)
        parcel.writeString(district_id)
        parcel.writeString(province_name)
        parcel.writeString(city_name)
        parcel.writeString(district_name)
        parcel.writeString(address)
        parcel.writeString(is_default)
        parcel.writeString(longitude)
        parcel.writeString(latitude)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<AddressDetailsData> {
        override fun createFromParcel(parcel: Parcel): AddressDetailsData {
            return AddressDetailsData(parcel)
        }

        override fun newArray(size: Int): Array<AddressDetailsData?> {
            return arrayOfNulls(size)
        }
    }

}